/*
 * date: 2009-11-20 
 * author: Maciej Smolenski <jezdnia@gmail.com>
 */
#include "common.hpp"
#include "rpc_config.hpp"
#ifdef CHECK
#include <unistd.h>
#endif

namespace rc=rpc_config;

void test()
{
	rc::stdset s; 

	rc::rpc_config_service<shmda_owner<rc::rpcm_config> > owner(SHARE_NAME, SHARE_SIZE);
	for(int i=0;i<1<<6;i++)
	{
		if (owner.get_hosts(s)==result_failure) PR_EXIT("get_hosts", EXIT_FAILURE);
		print_set(s, "\n");
		long delay;
		if (owner.get_delay(delay)==result_failure) PR_EXIT("get_delay", EXIT_FAILURE);
		PR("delay " << delay);
#ifdef CHECK
	sleep(3);
#endif
	}
}

int main(int argc, char *argv[])
{
	test();
	return 0;
}

